﻿@model IEnumerable<mesoBoard.Data.Post>

@{
    Layout = "~/Views/Shared/_Site.cshtml";
}

@section BreadCrumbContent {

@Html.ActionLink("Board Index", "Index", "Board")    
&raquo; @Html.BreadCrumbLink(new { @class = "current" })

}


    <div class="search section">
        @using(Html.BeginForm()){ 
            <h2>Search</h2>
            
            <dl>
                <dt>Keywords</dt>
                <dd>@Html.TextBox("Keywords", "", new { style="width: 300px" })</dd>
                
                <dt>&nbsp;</dt>
                <dd>
                    <input type="submit" value="Search" />
                </dd>
                
            </dl>
        } 
    </div>

    @if (Model != null)
    {
        <div class="search_results section">
           <h2>Search Results</h2>
            
           @{int i = 0;}
           @foreach (var post in Model){            
           <div class="result @(i++ % 2 == 0 ? "bg_color1" : "bg_color2")">
               Thread: 
               <label>
                   <a href="@Url.Action("ViewThread", "Board", new { ThreadID = post.ThreadID, PostID = post.PostID })  #@post.PostID">@post.Thread.Title </a>
               </label>

               <p class="text">
                   @post.TextOnly.Shorten(300)
               </p>
               <p>
                    by <strong>@Html.UserProfileLink(post.User.Username) </strong> on <strong>@post.Date.ToString("ddd, MMM dd \\'yy h:mm tt") </strong>
               </p>
           </div>
           <hr />
            }
           @if (Model.Count() == 0) { 
               <div>
                    No search results found, refine your search
               </div>
           } 
           
             @Html.Partial("_Pagination", ViewData["Pagination"])             
        </div>   
     } 


